Skip to content

BE-515: HashQL: Remove OFFSET 0 materialization fence from generated query#8650

Open
indietyp wants to merge 4 commits intobm/be-514-hashql-solver-iterate-forwardbackward-passes-to-convergencefrom
bm/be-515-hashql-remove-offset-0-materialization-fence-from-generated
Open

BE-515: HashQL: Remove OFFSET 0 materialization fence from generated query#8650
indietyp wants to merge 4 commits intobm/be-514-hashql-solver-iterate-forwardbackward-passes-to-convergencefrom
bm/be-515-hashql-remove-offset-0-materialization-fence-from-generated

Conversation

@indietyp
Copy link
Copy Markdown
Member

🌟 What is the purpose of this PR?

HashQL: Remove OFFSET 0 materialization fence from generated SQL

Problem

Each PostgreSQL island is wrapped in a CROSS JOIN LATERAL subquery. The subquery previously included OFFSET 0 as a materialization fence to prevent PostgreSQL's planner from inlining the CASE tree expression and duplicating it across each composite field access in the SELECT list.

The planner's cost estimate favors the fenced plan (lower estimated cost), but empirical benchmarks show the opposite for queries with conditional CASE trees:

Query Change (fenced → unfenced)
all_entities −11% (improved)
filter_by_uuid +10% (regressed)
diamond_cfg −5% (improved)
sequential_filters −72% (improved)
stress_test −77% (improved)

For multi-body queries with conditional branches, the materialization overhead exceeds the duplication cost by 3–4×. The fence helps modestly for simple single-expression queries without branching (filter_by_uuid), but is catastrophic for the common case.

🚢 Has this modified a publishable library?

This PR:

  • does not modify any publishable blocks or libraries, or modifications do not need publishing

📜 Does this require a change to the docs?

The changes in this PR:

  • are internal and do not require a docs change

🕸️ Does this require a change to the Turbo Graph?

The changes in this PR:

  • do not affect the execution graph

🛡 What tests cover this?

  • Existing test coverage for the HashQL eval Postgres module.

❓ How to test this?

  1. Checkout the branch.
  2. Run the existing test suite.
  3. Confirm all tests pass and query behavior is unchanged.

@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 21, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
hash Ready Ready Preview, Comment Apr 30, 2026 11:44am
2 Skipped Deployments
Project Deployment Actions Updated (UTC)
hashdotdesign-tokens Ignored Ignored Preview Apr 30, 2026 11:44am
petrinaut Skipped Skipped Apr 30, 2026 11:44am

Copy link
Copy Markdown
Member Author

indietyp commented Apr 21, 2026

Warning

This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
Learn more

This stack of pull requests is managed by Graphite. Learn more about stacking.

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 21, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 63.77%. Comparing base (5f2a3af) to head (a0db929).

Additional details and impacted files
@@                                            Coverage Diff                                            @@
##           bm/be-514-hashql-solver-iterate-forwardbackward-passes-to-convergence    #8650      +/-   ##
=========================================================================================================
- Coverage                                                                  63.85%   63.77%   -0.09%     
=========================================================================================================
  Files                                                                       1358     1358              
  Lines                                                                     143835   143501     -334     
  Branches                                                                    5649     5639      -10     
=========================================================================================================
- Hits                                                                       91847    91515     -332     
+ Misses                                                                     51015    51013       -2     
  Partials                                                                     973      973              
Flag Coverage Δ
apps.hash-ai-worker-ts 1.40% <ø> (ø)
apps.hash-api 0.00% <ø> (ø)
local.hash-graph-sdk 9.63% <ø> (ø)
local.hash-isomorphic-utils 0.00% <ø> (ø)
rust.hash-graph-api 2.52% <ø> (ø)
rust.hashql-compiletest 28.26% <ø> (ø)
rust.hashql-eval 79.70% <ø> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@codspeed-hq
Copy link
Copy Markdown

codspeed-hq Bot commented Apr 21, 2026

Merging this PR will not alter performance

✅ 80 untouched benchmarks


Comparing bm/be-515-hashql-remove-offset-0-materialization-fence-from-generated (9db238d) with bm/be-514-hashql-solver-iterate-forwardbackward-passes-to-convergence (dadf2c4)

Open in CodSpeed

@indietyp indietyp force-pushed the bm/be-514-hashql-solver-iterate-forwardbackward-passes-to-convergence branch from dadf2c4 to f03cb6f Compare April 29, 2026 13:08
@indietyp indietyp force-pushed the bm/be-515-hashql-remove-offset-0-materialization-fence-from-generated branch from 9db238d to 76f9530 Compare April 29, 2026 13:08
@github-actions github-actions Bot removed the area/deps Relates to third-party dependencies (area) label Apr 29, 2026
@vercel vercel Bot temporarily deployed to Preview – petrinaut April 29, 2026 15:42 Inactive
@indietyp indietyp marked this pull request as ready for review April 29, 2026 15:42
@cursor
Copy link
Copy Markdown

cursor Bot commented Apr 29, 2026

PR Summary

Medium Risk
Changes the shape of generated SQL in a performance-sensitive area; behavior should be equivalent but query plans (and thus latency) can shift, including potential regressions for simple filters.

Overview
Removes the OFFSET 0 materialization fence from Postgres island CROSS JOIN LATERAL continuation subqueries, changing the generated SQL to allow the planner to inline the subquery rather than forcing per-row materialization.

Updates continuation-related documentation/comments and rewrites all affected Postgres UI test snapshots/stdouts to match the new unfenced LATERAL SQL shape.

Reviewed by Cursor Bugbot for commit a0db929. Bugbot is set up for automated code reviews on this repo. Configure here.

Comment thread libs/@local/hashql/eval/src/postgres/mod.rs
@indietyp indietyp force-pushed the bm/be-514-hashql-solver-iterate-forwardbackward-passes-to-convergence branch from 211c141 to 080f3e8 Compare April 29, 2026 15:51
@indietyp indietyp force-pushed the bm/be-515-hashql-remove-offset-0-materialization-fence-from-generated branch from e340184 to 0048198 Compare April 29, 2026 15:51
@vercel vercel Bot temporarily deployed to Preview – petrinaut April 29, 2026 15:51 Inactive
@github-actions github-actions Bot added the area/tests New or updated tests label Apr 29, 2026
@vercel vercel Bot temporarily deployed to Preview – petrinaut April 29, 2026 15:54 Inactive
@augmentcode
Copy link
Copy Markdown

augmentcode Bot commented Apr 29, 2026

🤖 Augment PR Summary

Summary: Removes the OFFSET 0 materialization fence from generated Postgres lateral subqueries in HashQL evaluation.
Why: This avoids unnecessary materialization overhead and aligns the generated SQL with benchmark results showing better performance for multi-branch CASE-tree queries.

🤖 Was this summary useful? React with 👍 or 👎

Copy link
Copy Markdown

@augmentcode augmentcode Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review completed. 1 suggestion posted.

Fix All in Augment

Comment augment review to trigger a new review at any time.

Comment thread libs/@local/hashql/eval/src/postgres/mod.rs
@indietyp indietyp force-pushed the bm/be-515-hashql-remove-offset-0-materialization-fence-from-generated branch from 05b37e4 to 7a113b5 Compare April 30, 2026 08:53
@indietyp indietyp force-pushed the bm/be-514-hashql-solver-iterate-forwardbackward-passes-to-convergence branch from 080f3e8 to 0ca8770 Compare April 30, 2026 08:53
@vercel vercel Bot temporarily deployed to Preview – petrinaut April 30, 2026 08:53 Inactive
@indietyp indietyp force-pushed the bm/be-515-hashql-remove-offset-0-materialization-fence-from-generated branch from 7a113b5 to c5c10fa Compare April 30, 2026 09:02
@indietyp indietyp force-pushed the bm/be-514-hashql-solver-iterate-forwardbackward-passes-to-convergence branch from 0ca8770 to b02766e Compare April 30, 2026 09:02
@vercel vercel Bot temporarily deployed to Preview – petrinaut April 30, 2026 09:02 Inactive
@indietyp indietyp force-pushed the bm/be-515-hashql-remove-offset-0-materialization-fence-from-generated branch from c5c10fa to 526e21d Compare April 30, 2026 09:04
@indietyp indietyp force-pushed the bm/be-514-hashql-solver-iterate-forwardbackward-passes-to-convergence branch from b02766e to f2b4e96 Compare April 30, 2026 09:04
@vercel vercel Bot temporarily deployed to Preview – petrinaut April 30, 2026 09:04 Inactive
@indietyp indietyp force-pushed the bm/be-515-hashql-remove-offset-0-materialization-fence-from-generated branch from 526e21d to 2cf065b Compare April 30, 2026 09:06
@indietyp indietyp force-pushed the bm/be-514-hashql-solver-iterate-forwardbackward-passes-to-convergence branch from f2b4e96 to 1c2cf8c Compare April 30, 2026 09:06
@vercel vercel Bot temporarily deployed to Preview – petrinaut April 30, 2026 09:06 Inactive
Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit caff769. Configure here.

//!
//! Each postgres island in a filter body produces a `CROSS JOIN LATERAL` subquery
//! that evaluates its CASE tree once per row (via `OFFSET 0`) and returns a
//! that evaluates its CASE tree once per row and returns a
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Double space in doc comment after editing

Low Severity

After removing "(via OFFSET 0)" from the doc comment, a double space remains between "once per row" and "and returns a" on line 4. Minor formatting artifact from the edit.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit caff769. Configure here.

@github-actions
Copy link
Copy Markdown
Contributor

Benchmark results

@rust/hash-graph-benches – Integrations

policy_resolution_large

Function Value Mean Flame graphs
resolve_policies_for_actor user: empty, selectivity: high, policies: 2002 $$26.4 \mathrm{ms} \pm 119 \mathrm{μs}\left({\color{gray}2.32 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: empty, selectivity: low, policies: 1 $$2.84 \mathrm{ms} \pm 14.1 \mathrm{μs}\left({\color{gray}0.338 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: empty, selectivity: medium, policies: 1001 $$11.6 \mathrm{ms} \pm 65.6 \mathrm{μs}\left({\color{gray}1.71 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: seeded, selectivity: high, policies: 3314 $$37.4 \mathrm{ms} \pm 310 \mathrm{μs}\left({\color{gray}-1.409 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: seeded, selectivity: low, policies: 1 $$11.4 \mathrm{ms} \pm 92.6 \mathrm{μs}\left({\color{gray}2.28 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: seeded, selectivity: medium, policies: 1526 $$20.6 \mathrm{ms} \pm 140 \mathrm{μs}\left({\color{gray}-2.779 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: high, policies: 2078 $$26.7 \mathrm{ms} \pm 202 \mathrm{μs}\left({\color{gray}-0.927 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: low, policies: 1 $$3.11 \mathrm{ms} \pm 14.1 \mathrm{μs}\left({\color{gray}0.042 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: medium, policies: 1033 $$12.5 \mathrm{ms} \pm 80.1 \mathrm{μs}\left({\color{gray}1.00 \mathrm{\%}}\right) $$ Flame Graph

policy_resolution_medium

Function Value Mean Flame graphs
resolve_policies_for_actor user: empty, selectivity: high, policies: 102 $$3.13 \mathrm{ms} \pm 18.6 \mathrm{μs}\left({\color{gray}-0.256 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: empty, selectivity: low, policies: 1 $$2.47 \mathrm{ms} \pm 21.2 \mathrm{μs}\left({\color{gray}3.60 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: empty, selectivity: medium, policies: 51 $$2.74 \mathrm{ms} \pm 14.2 \mathrm{μs}\left({\color{gray}0.667 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: seeded, selectivity: high, policies: 269 $$4.45 \mathrm{ms} \pm 19.2 \mathrm{μs}\left({\color{gray}0.975 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: seeded, selectivity: low, policies: 1 $$2.89 \mathrm{ms} \pm 11.9 \mathrm{μs}\left({\color{gray}0.448 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: seeded, selectivity: medium, policies: 107 $$3.43 \mathrm{ms} \pm 16.9 \mathrm{μs}\left({\color{gray}0.935 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: high, policies: 133 $$3.74 \mathrm{ms} \pm 20.5 \mathrm{μs}\left({\color{gray}0.334 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: low, policies: 1 $$2.81 \mathrm{ms} \pm 10.7 \mathrm{μs}\left({\color{gray}-1.841 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: medium, policies: 63 $$3.35 \mathrm{ms} \pm 15.0 \mathrm{μs}\left({\color{gray}0.251 \mathrm{\%}}\right) $$ Flame Graph

policy_resolution_none

Function Value Mean Flame graphs
resolve_policies_for_actor user: empty, selectivity: high, policies: 2 $$2.13 \mathrm{ms} \pm 11.5 \mathrm{μs}\left({\color{gray}0.766 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: empty, selectivity: low, policies: 1 $$2.02 \mathrm{ms} \pm 9.69 \mathrm{μs}\left({\color{gray}0.472 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: empty, selectivity: medium, policies: 1 $$2.11 \mathrm{ms} \pm 8.24 \mathrm{μs}\left({\color{gray}-0.122 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: high, policies: 8 $$2.33 \mathrm{ms} \pm 10.1 \mathrm{μs}\left({\color{gray}0.248 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: low, policies: 1 $$2.20 \mathrm{ms} \pm 12.3 \mathrm{μs}\left({\color{gray}0.504 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: medium, policies: 3 $$2.32 \mathrm{ms} \pm 12.0 \mathrm{μs}\left({\color{gray}0.407 \mathrm{\%}}\right) $$ Flame Graph

policy_resolution_small

Function Value Mean Flame graphs
resolve_policies_for_actor user: empty, selectivity: high, policies: 52 $$2.46 \mathrm{ms} \pm 13.5 \mathrm{μs}\left({\color{gray}1.43 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: empty, selectivity: low, policies: 1 $$2.22 \mathrm{ms} \pm 9.64 \mathrm{μs}\left({\color{gray}0.814 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: empty, selectivity: medium, policies: 25 $$2.40 \mathrm{ms} \pm 10.7 \mathrm{μs}\left({\color{gray}-0.511 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: seeded, selectivity: high, policies: 94 $$2.78 \mathrm{ms} \pm 16.0 \mathrm{μs}\left({\color{gray}0.816 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: seeded, selectivity: low, policies: 1 $$2.38 \mathrm{ms} \pm 9.85 \mathrm{μs}\left({\color{gray}0.705 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: seeded, selectivity: medium, policies: 26 $$2.64 \mathrm{ms} \pm 13.2 \mathrm{μs}\left({\color{gray}0.980 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: high, policies: 66 $$2.67 \mathrm{ms} \pm 11.9 \mathrm{μs}\left({\color{gray}-0.239 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: low, policies: 1 $$2.39 \mathrm{ms} \pm 13.2 \mathrm{μs}\left({\color{gray}1.12 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: medium, policies: 29 $$2.67 \mathrm{ms} \pm 12.9 \mathrm{μs}\left({\color{gray}0.709 \mathrm{\%}}\right) $$ Flame Graph

read_scaling_complete

Function Value Mean Flame graphs
entity_by_id;one_depth 1 entities $$47.7 \mathrm{ms} \pm 178 \mathrm{μs}\left({\color{gray}-0.693 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;one_depth 10 entities $$39.6 \mathrm{ms} \pm 153 \mathrm{μs}\left({\color{gray}0.294 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;one_depth 25 entities $$42.7 \mathrm{ms} \pm 177 \mathrm{μs}\left({\color{gray}-0.910 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;one_depth 5 entities $$37.5 \mathrm{ms} \pm 170 \mathrm{μs}\left({\color{gray}-1.279 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;one_depth 50 entities $$54.5 \mathrm{ms} \pm 240 \mathrm{μs}\left({\color{gray}0.825 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;two_depth 1 entities $$53.9 \mathrm{ms} \pm 188 \mathrm{μs}\left({\color{gray}-4.059 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;two_depth 10 entities $$48.0 \mathrm{ms} \pm 191 \mathrm{μs}\left({\color{gray}1.26 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;two_depth 25 entities $$85.1 \mathrm{ms} \pm 322 \mathrm{μs}\left({\color{lightgreen}-7.476 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;two_depth 5 entities $$38.8 \mathrm{ms} \pm 149 \mathrm{μs}\left({\color{gray}-1.812 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;two_depth 50 entities $$280 \mathrm{ms} \pm 887 \mathrm{μs}\left({\color{gray}-3.002 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;zero_depth 1 entities $$16.7 \mathrm{ms} \pm 82.5 \mathrm{μs}\left({\color{gray}3.22 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;zero_depth 10 entities $$17.4 \mathrm{ms} \pm 75.1 \mathrm{μs}\left({\color{gray}0.597 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;zero_depth 25 entities $$17.6 \mathrm{ms} \pm 102 \mathrm{μs}\left({\color{gray}1.27 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;zero_depth 5 entities $$16.5 \mathrm{ms} \pm 83.6 \mathrm{μs}\left({\color{gray}-2.517 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;zero_depth 50 entities $$20.8 \mathrm{ms} \pm 183 \mathrm{μs}\left({\color{gray}2.51 \mathrm{\%}}\right) $$ Flame Graph

read_scaling_linkless

Function Value Mean Flame graphs
entity_by_id 1 entities $$16.4 \mathrm{ms} \pm 66.1 \mathrm{μs}\left({\color{gray}1.35 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id 10 entities $$16.7 \mathrm{ms} \pm 85.8 \mathrm{μs}\left({\color{gray}2.27 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id 100 entities $$16.5 \mathrm{ms} \pm 85.1 \mathrm{μs}\left({\color{gray}-0.156 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id 1000 entities $$17.2 \mathrm{ms} \pm 67.1 \mathrm{μs}\left({\color{gray}-1.500 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id 10000 entities $$24.0 \mathrm{ms} \pm 151 \mathrm{μs}\left({\color{gray}1.54 \mathrm{\%}}\right) $$ Flame Graph

representative_read_entity

Function Value Mean Flame graphs
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/block/v/1 $$31.5 \mathrm{ms} \pm 230 \mathrm{μs}\left({\color{gray}2.07 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/book/v/1 $$31.7 \mathrm{ms} \pm 245 \mathrm{μs}\left({\color{gray}3.72 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/building/v/1 $$29.9 \mathrm{ms} \pm 244 \mathrm{μs}\left({\color{lightgreen}-5.757 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/organization/v/1 $$30.7 \mathrm{ms} \pm 277 \mathrm{μs}\left({\color{gray}-0.301 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/page/v/2 $$30.8 \mathrm{ms} \pm 266 \mathrm{μs}\left({\color{gray}-3.183 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/person/v/1 $$31.0 \mathrm{ms} \pm 286 \mathrm{μs}\left({\color{gray}-2.494 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/playlist/v/1 $$31.6 \mathrm{ms} \pm 327 \mathrm{μs}\left({\color{gray}2.65 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/song/v/1 $$32.0 \mathrm{ms} \pm 328 \mathrm{μs}\left({\color{gray}-2.764 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/uk-address/v/1 $$31.5 \mathrm{ms} \pm 297 \mathrm{μs}\left({\color{gray}-1.020 \mathrm{\%}}\right) $$ Flame Graph

representative_read_entity_type

Function Value Mean Flame graphs
get_entity_type_by_id Account ID: bf5a9ef5-dc3b-43cf-a291-6210c0321eba $$6.92 \mathrm{ms} \pm 30.1 \mathrm{μs}\left({\color{gray}-1.928 \mathrm{\%}}\right) $$ Flame Graph

representative_read_multiple_entities

Function Value Mean Flame graphs
entity_by_property traversal_paths=0 0 $$91.6 \mathrm{ms} \pm 393 \mathrm{μs}\left({\color{gray}-1.702 \mathrm{\%}}\right) $$
entity_by_property traversal_paths=255 1,resolve_depths=inherit:1;values:255;properties:255;links:127;link_dests:126;type:true $$137 \mathrm{ms} \pm 600 \mathrm{μs}\left({\color{gray}0.151 \mathrm{\%}}\right) $$
entity_by_property traversal_paths=2 1,resolve_depths=inherit:0;values:0;properties:0;links:0;link_dests:0;type:false $$98.1 \mathrm{ms} \pm 386 \mathrm{μs}\left({\color{gray}0.639 \mathrm{\%}}\right) $$
entity_by_property traversal_paths=2 1,resolve_depths=inherit:0;values:0;properties:0;links:1;link_dests:0;type:true $$110 \mathrm{ms} \pm 383 \mathrm{μs}\left({\color{gray}3.92 \mathrm{\%}}\right) $$
entity_by_property traversal_paths=2 1,resolve_depths=inherit:0;values:0;properties:2;links:1;link_dests:0;type:true $$113 \mathrm{ms} \pm 498 \mathrm{μs}\left({\color{gray}1.60 \mathrm{\%}}\right) $$
entity_by_property traversal_paths=2 1,resolve_depths=inherit:0;values:2;properties:2;links:1;link_dests:0;type:true $$119 \mathrm{ms} \pm 631 \mathrm{μs}\left({\color{gray}-2.127 \mathrm{\%}}\right) $$
link_by_source_by_property traversal_paths=0 0 $$97.5 \mathrm{ms} \pm 359 \mathrm{μs}\left({\color{gray}-0.790 \mathrm{\%}}\right) $$
link_by_source_by_property traversal_paths=255 1,resolve_depths=inherit:1;values:255;properties:255;links:127;link_dests:126;type:true $$123 \mathrm{ms} \pm 626 \mathrm{μs}\left({\color{gray}-0.543 \mathrm{\%}}\right) $$
link_by_source_by_property traversal_paths=2 1,resolve_depths=inherit:0;values:0;properties:0;links:0;link_dests:0;type:false $$104 \mathrm{ms} \pm 459 \mathrm{μs}\left({\color{gray}-1.952 \mathrm{\%}}\right) $$
link_by_source_by_property traversal_paths=2 1,resolve_depths=inherit:0;values:0;properties:0;links:1;link_dests:0;type:true $$112 \mathrm{ms} \pm 495 \mathrm{μs}\left({\color{gray}-0.463 \mathrm{\%}}\right) $$
link_by_source_by_property traversal_paths=2 1,resolve_depths=inherit:0;values:0;properties:2;links:1;link_dests:0;type:true $$113 \mathrm{ms} \pm 510 \mathrm{μs}\left({\color{gray}-1.020 \mathrm{\%}}\right) $$
link_by_source_by_property traversal_paths=2 1,resolve_depths=inherit:0;values:2;properties:2;links:1;link_dests:0;type:true $$112 \mathrm{ms} \pm 465 \mathrm{μs}\left({\color{gray}-1.924 \mathrm{\%}}\right) $$

scenarios

Function Value Mean Flame graphs
full_test query-limited $$161 \mathrm{ms} \pm 702 \mathrm{μs}\left({\color{gray}-2.337 \mathrm{\%}}\right) $$ Flame Graph
full_test query-unlimited $$131 \mathrm{ms} \pm 479 \mathrm{μs}\left({\color{gray}-2.120 \mathrm{\%}}\right) $$ Flame Graph
linked_queries query-limited $$35.4 \mathrm{ms} \pm 129 \mathrm{μs}\left({\color{gray}-1.476 \mathrm{\%}}\right) $$ Flame Graph
linked_queries query-unlimited $$493 \mathrm{ms} \pm 819 \mathrm{μs}\left({\color{gray}1.36 \mathrm{\%}}\right) $$ Flame Graph

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/libs Relates to first-party libraries/crates/packages (area) area/tests New or updated tests type/eng > backend Owned by the @backend team

Development

Successfully merging this pull request may close these issues.

1 participant